<template>
  <div class="made">
    <div class="newsHeader">
      <a href="#" @click="back">
        <img src="../../static/img/fanhui@2x.png" alt="">
      </a>
      <span>oppo代言</span>
    </div>
    <div class="swipe">
      <mt-swipe :auto="4000">
        <mt-swipe-item>
          <img
            src="../../static/img/made1.png"
            alt="轮播图">
        </mt-swipe-item>
        <mt-swipe-item>
          <img
            src="../../static/img/made2.png"
            alt="轮播图">
        </mt-swipe-item>
        <mt-swipe-item>
          <img
            src="../../static/img/made3.png"
            alt="轮播图">
        </mt-swipe-item>
        <mt-swipe-item>
          <img
            src="../../static/img/made4.png"
            alt="轮播图">
        </mt-swipe-item>
        <mt-swipe-item>
          <img
            src="../../static/img/made5.png"
            alt="轮播图">
        </mt-swipe-item>
        <mt-swipe-item>
          <img
            src="../../static/img/made6.png"
            alt="轮播图">
        </mt-swipe-item>
        <mt-swipe-item>
          <img
            src="../../static/img/made7.png"
            alt="轮播图">
        </mt-swipe-item>
      </mt-swipe>
    </div>
    <div class="people">
      <ul>
        <li v-for="(lis,index) in list" :key="index" @click="madeDetail(lis.id)" :id="lis.id">
          <div class="peo_img" v-lazy:background-image="`${lis.ImageOne}`"></div>
          <div class="des">
            <p>{{lis.name}}</p>
            <p>{{lis.nametwo}}</p>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>
<style>
  .made {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 999;
  }

  .newsHeader {
    width: 100%;
    z-index: 1;
    height: 1.3rem;
    line-height: 1.3rem;
    font-size: 15px;
    background: #3aab35;
    position: fixed;
    top: 0;
    left: 0;
    -webkit-box-shadow: 0 0 10px #cecece;
    box-shadow: 0 0 10px #cecece;
    text-align: center;
    color: #fff;
  }

  .newsHeader img {
    display: block;
    float: left;
    width: 9px;
    height: 16px;
    padding: 16px;
    color: black;
  }

  .swipe {
    height: 200px;
    margin-top: 50px;
  }

  .swipe img {
    width: 100%;
    height: 200px;
  }

  .people {
    width: 100%;
  }

  .people ul {
    margin-left: -40px;
  }

  .people ul li {
    width: 100%;
    list-style: none;
    height: 100px;
    border-bottom: 1px solid #f2f2f2;
  }
  .people ul li:last-child{
    border-bottom:0;
  }
  .people ul li .peo_img {
    float: left;
    width: 100px;
    border-right: 1px solid #f2f2f2;
    height: 100%;
    background-size: 100px 100px;
  }

  .people ul li .des {
    float: left;
    width: 70%;
    height: 100%;
    text-align: center;
  }
  .people ul li .des p{
    font-size: 15px;
    color: #63a35c;
    line-height: 20px;
  }
</style>
<script>
  export default {
    name: 'made',
    data() {
      return {
        list: []
      }
    },
    mounted() {
      this.getlist()
    },
    methods: {
      back() {
        this.$router.go(-1)
      },
      getlist() {
        this.$http.get('/static/made.json').then(res => {
          // console.log(res)
          if (res.status === 200) {
            this.list = res.body.mades
            // console.log(this.list)
          }
        })
      },
      madeDetail(id){
        this.$router.push({path:'madeDetail',query:{id:id}})
      }
    }
  }
</script>
